<?php
/**
 * Model for administration resource
 *
 * @category   Application
 * @package    Application_Administrator
 * @subpackage Model
 *
 * @version  $Id$
 */

class Administrator_Model_Resource extends Core_Model_Abstract
{
    protected $_mapperName = 'Administrator_Model_ResourceMapper';

    protected $_currentPage = 1;

    public function setPage($page)
    {
        $this->_currentPage = $page;
    }

    public function getPage()
    {
        return $_currentPage;
    }

    /**
     * Get resources
     *
     * @return array
     */
    public function getResources()
    {
        $rows = array();
        $data = $this->getMapper()->getResources($this);
        foreach($data as $row) {
            $rows[] = array($row->resource_id, $row->resource, $row->parent_id);
        }
        return $rows;
    }
}

